package com.exrobot.module.rbt.dal.mysql.robotappversion;

import java.util.*;

import com.exrobot.framework.common.pojo.PageResult;
import com.exrobot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.exrobot.framework.mybatis.core.mapper.BaseMapperX;
import com.exrobot.module.rbt.dal.dataobject.robotappversion.RobotAppVersionDO;
import org.apache.ibatis.annotations.Mapper;
import com.exrobot.module.rbt.controller.admin.robotappversion.vo.*;

/**
 * 机器人APP版本 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RobotAppVersionMapper extends BaseMapperX<RobotAppVersionDO> {

    default PageResult<RobotAppVersionDO> selectPage(RobotAppVersionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotAppVersionDO>()
                .eqIfPresent(RobotAppVersionDO::getVersionCode, reqVO.getVersionCode())
                .likeIfPresent(RobotAppVersionDO::getVersionName, reqVO.getVersionName())
                .eqIfPresent(RobotAppVersionDO::getDownloadUrl, reqVO.getDownloadUrl())
                .eqIfPresent(RobotAppVersionDO::getReleaseNotes, reqVO.getReleaseNotes())
                .betweenIfPresent(RobotAppVersionDO::getForceUpdate, reqVO.getForceUpdate())
                .betweenIfPresent(RobotAppVersionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotAppVersionDO::getId));
    }

}